#pragma once
#include<iostream>
using namespace std;

class Array {
public:
	Array(int(*p)[4]);
	~Array(){}
	void operator++(int);
	friend void operator--(Array& b);
	void display();
private:
	int b[4][4];
};


Array::Array(int(*p)[4]){
	int i,j;
	for (i = 0; i < 4; i++)
	{
		for (j = 0; j < 4; j++)
		{
			b[i][j] = p[i][j];
		}
	}
}


void Array::operator++(int) {
	int i, j;
	int c[4][4];
	
	for (i = 0; i < 4; i++)
	{
		for (j = 0; j < 4; j++)
		{
			c[i][j] = b[i][j];
		}
	}

	for (i = 0; i < 4; i++)
	{
		for (j = 0; j < 4; j++)
		{
			b[j][3 - i] = c[i][j];
		}
	}
}

void operator--(Array& x) {
	int i, j;
	int c[4][4];

	for (i = 0; i < 4; i++)
	{
		for (j = 0; j < 4; j++)
		{
			c[i][j] = x.b[i][j];
		}
	}

	for (i = 0; i < 4; i++)
	{
		for (j = 0; j < 4; j++)
		{
			x.b[3-j][i] = c[i][j];
		}
	}
}

void Array::display() {

	int i, j;

	for (i = 0; i < 4; i++)
	{
		for (j = 0; j < 4; j++)
		{
			cout << b[i][j] << " ";
		}
		cout << endl;
	}
}
